import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { ProjectComponent } from './project/project.component';
import { UserComponent } from './user/user.component';
import { LicenseComponent } from './license/license.component';
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
import {RouterModule, Routes} from '@angular/router';
import {DataService} from './data.service';
import { PasswordComponent } from './password/password.component';
import { LayoutComponent } from './layout/layout.component';
import { LoginComponent } from './login/login.component';
import { ConfigtableComponent } from './configtable/configtable.component';



const routeConfig: Routes = [
  {path: '', redirectTo: '/home', pathMatch: 'full'},
  {path: 'project', component: ProjectComponent},
  {path: 'user', component: UserComponent},
  {path: 'home', component: HomeComponent},
  {path: 'license', component: LicenseComponent},
  {path: 'password', component: PasswordComponent},
  {path: 'config', component: ConfigtableComponent},
  {path: 'layout', component: LayoutComponent},
];

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    ProjectComponent,
    UserComponent,
    LicenseComponent,
    PasswordComponent,
    LayoutComponent,
    LoginComponent,
    ConfigtableComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    NgZorroAntdModule.forRoot(),
    RouterModule.forRoot(routeConfig),
  ],
  providers: [
    DataService, { provide: LocationStrategy, useClass: HashLocationStrategy, }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
